package com.student.Activitys.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.student.Activitys.R;
import com.student.Activitys.activity.base.BaseActivity;
import com.student.Activitys.adapter.EvaluateResultAdapter;
import com.student.Activitys.bean.EvaluateNewsBean;
import com.student.Activitys.utils.Constant;
import com.student.Activitys.view.recyleview.FullyLinearLayoutManager;

import java.util.List;

import butterknife.Bind;

/**
 * 项目名称：智慧校园学生端
 * 类描述：评价结果
 * 创建人：张飞祥
 * 创建时间：2017/10/10 10:25
 * 修改人：张飞祥
 * 修改时间：2017/10/10 10:25
 * 修改备注：
 */
public class EvaluateResultActivity extends BaseActivity {

    @Bind(R.id.iv_return)
    ImageView ivReturn;
    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.rv_evaluate_result_list)
    RecyclerView rvEvaluateResultList;
    @Bind(R.id.tv_evaluate_result_place)
    TextView tvEvaluateResultPlace;
    @Bind(R.id.tv_evaluate_result_reason)
    TextView tvEvaluateResultReason;

    //评价所需 星星
    private EvaluateResultAdapter adapter;
    //评价理由
    private  String pjly = "";
    //上课地点
    private  String szdd = "";
    //星星集合
    private List<EvaluateNewsBean> list = null;

    @Override
    protected void initUI() {
        setContentView(R.layout.act_evaluate_result);
    }

    @Override
    protected void initData() {
        //标题
        tvTitle.setText("评价详情");
        //返回键
        ivReturn.setVisibility(View.VISIBLE);
        // 获取传递过来的封了数据的Bundle
        Bundle bundle = this.getIntent().getExtras();
        // 获取 传递过来的 实体 数据
        pjly = bundle.getString(Constant.PJLY);
        szdd = bundle.getString(Constant.SZDD);
        list = (List<EvaluateNewsBean>) bundle.getSerializable(Constant.EVALUATE_PJFS);
        //状态评价列表
        adapter = new EvaluateResultAdapter(EvaluateResultActivity.this, list);
        //塞入列表数据
        rvEvaluateResultList.setLayoutManager(new FullyLinearLayoutManager(EvaluateResultActivity.this, LinearLayoutManager.VERTICAL, false));
        rvEvaluateResultList.setAdapter(adapter);
        //上课地点
        tvEvaluateResultPlace.setText(szdd);
        //评价理由
        tvEvaluateResultReason.setText(pjly);
        //返回键监听
        ivReturn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void getNotData() {

    }
}
